package cn.poem.controller;

import cn.poem.base.ResponseData;
import cn.poem.entity.PoetryBase;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*;

/**
 * @Description 诗词
 * @Author sugar
 * @Date 2021/6/8 4:35 PM
 * @Version 1.0
 */
@RequestMapping("poem/poetry/")
public interface PoetryController {

    /**
     * 1。今日推荐 一首， 或是地点，或是日历
     * <p>
     * 2。诗词列表 这边需要分页 带着条件查询
     * <p>
     * 3。收藏夹里的诗词 分页
     */
    /**
     * 今日推荐
     *
     * @return
     */
    @GetMapping("recommend")
    ResponseData<PoetryBase> recommendPoetry();

    /**
     * 分页
     *
     * @param page
     * @param size
     * @param p
     * @return
     */
    @GetMapping("page/{page}/{size}")
    ResponseData<IPage<PoetryBase>> poetryPage(@PathVariable("page") int page, @PathVariable("size") int size, PoetryBase p);

    /**
     * 详情信息
     *
     * @param pid
     * @return
     */
    @GetMapping("detail/{pid}}")
    ResponseData<PoetryBase> poetryDetail(@PathVariable("pid") long pid);


    @PostMapping("save")
    ResponseData<Boolean> savePoetry(@RequestBody PoetryBase poetryBase);

    @DeleteMapping("del/{pid}")
    ResponseData<Boolean> delPoetry(@PathVariable("pid") Long pid);
}
